CFLAGS=/nologo /GS- /Gy- /GR- /Oi /O1 /D_NO_CRT_STDIO_INLINE /D_CRT_SECURE_NO_WARNINGS /W3
LDFLAGS=/nodefaultlib /incremental:no /safeseh:no /subsystem:console,5.01 /merge:.rdata=.text /EMITPOGOPHASEINFO /stub:t.bin /ALIGN:16 kernel32.lib msvcrt.lib

all: code-minimap.exe

code-minimap.exe: code-minimap.c msvcrt.lib t.bin Makefile
	@cl $(CFLAGS) code-minimap.c /Fecode-minimap.exe /link $(LDFLAGS)

msvcrt.lib: msvcrt.def Makefile
	@lib /nologo /def:msvcrt.def /out:msvcrt.lib

t.bin: Makefile
	@echo MZ............................................................> t.bin

.PHONY: all clean dist-clean

clean:
	@del t.bin
	@del *.lib
	@del *.exp
	@del *.obj
	@del *.pdb

dist-clean:
	@del *.exe
	@nmake clean